<template>
  <div class="userList back-white">
    <div>
        <page-title>分享标题</page-title> 
    </div>   
    <div class="content clear-both "> 
        <div class="content-group">
            <div class="text-center title">平台分享标题</div>
            <div class="group-input">
                <el-input
                    type="textarea"
                    :autosize="{ minRows: 2, maxRows: 4}"
                    placeholder="请输入内容"
                    maxlength="30"
                    show-word-limit
                    v-model="content">
                </el-input>
            </div>
        </div> 
        <div class="content-group">
            <div class="text-center title">VIP分享标题</div>
            <div class="group-input">
                <el-input
                    type="textarea"
                    :autosize="{ minRows: 2, maxRows: 4}"
                    placeholder="请输入内容"
                    maxlength="30"
                    show-word-limit
                    v-model="vip_content">
                </el-input>
            </div>
        </div> 
        <div class="text-center">
            <el-button type="primary" @click='onSubmit'>提交</el-button>
        </div>
    </div>   
  </div>
</template>
<script >
  import * as api from './../../../api/api';
  export default {
    data(){
      return {     
        content:'',
        vip_content:'',
      }
    },
    created(){
      this.getPhotowallListData(); 
    },
    methods:{ 
        //获取用户列表数据
        getPhotowallListData(){ 
            let vm = this;  
            api.getShareTitleContent().then(res=>{  
                if(res.data.code==300000&&res.data.data){ 
                    vm.content=res.data.data.content;
                    vm.vip_content=res.data.data.vip_content;
                }
            })
        },
        onSubmit(){
            let vm = this;  
            let body={
                content:vm.content,
                vip_content:vm.vip_content,
            };
            api.editShareTitle(body).then(res=>{  
                if(res.data.code==300000&&res.data.data){ 
                    this.$message({
                        message: '修改成功',
                        type: 'success'
                    });
                }
            })
        }   
    }
  }
</script>
<style lang="scss" scoped> 
    .content{
        width:100%;
        height:100%;
        padding:20px;
        .content-group{
            margin-bottom:20px;
            
            .group-input{
                 width:500px;
                 margin:20px auto;
            }
            .title{
                font-weight: bold;
            } 
        }
         
    }  
</style>